package PTA3.ti25;

import java.util.Scanner;

/**
 * @author Lenovo
 */

class Square {
    private int edge;

    public Square() {
        this.edge = 2;
        System.out.println("this is constructor method");
    }

    public void setEdge(int edge) {
        this.edge = edge <= 0 ? 1 : edge;
    }

    public int getEdge() {
        return edge;
    }

    public int getArea() {
        return edge * edge;
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Square s1 = new Square();
        System.out.println("s1:edge=" + s1.getEdge());
        System.out.println("s1:area=" + s1.getArea());
        Square s2 = new Square();
        int edge = scanner.nextInt();
        s2.setEdge(edge);
        System.out.println("s2:edge=" + s2.getEdge());
        System.out.println("s2:area=" + s2.getArea());
    }
}
